package com.multi.tool.reflection.normal;

import java.lang.reflect.Field;
import java.util.List;

public class Test {

    public static void main(String[] args) {
        try {

            Class<B> bClass  = B.class;

            Field field = bClass.getDeclaredField("str");

            field.setAccessible(true);

            List<String> str = (List<String>) field.get(B.class.newInstance());

            System.out.println("toString打印: "+str);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
